<h4>DATA PERKULIAHAN &raquo; <span class="current_page">JADWAL KULIAH</span></h4>

            <!-- Begin three column window -->
<div class="onecolumn" style="padding-bottom:20px">
    <div class="header">
    <span><b>JADWAL KULIAH</b>: SEMESTER <?php echo $kontrol->SEMESTER; ?> <?php echo $kontrol->TAHUN_AJARAN; ?></span>
    <div class="switch" style="width:200px; padding-top:14px">
    <table width="200px" cellpadding="0" cellspacing="0">
    		<tbody>
    			<tr>
    				<td align="right">
    					    <img src="<?php echo base_url().'images/cetak.png' ?>" align=top /> <?php $linkku="siam/cetak-jadwal-kuliah.html"; echo anchor_popup($linkku, 'CETAK JADWAL KULIAH', $atts);?>
    				</td>
                </tr>
    		</tbody>
    		</table>
    </div>
    </div>
	<br class="clear" /> 


<div class="text">
 <br />
 <table border="1" cellpadding="5" cellspacing="0" style="border: solid 1.5pt black; border-collapse: collapse" bordercolor="#000000" align="center">
            <tr align="center">
                <th width="50" height="43" style="border-bottom: solid 1.5pt black">Hari</th>
                <th width="97" style="border-bottom: solid 1.5pt black">Jam</th>
                <th width="70" style="border-bottom: solid 1.5pt black">Kode MK</th>
                <th width="210" style="border-bottom: solid 1.5pt black">Nama MK</th>
                <th width="40" style="border-bottom: solid 1.5pt black">SKS</th>
                <th width="60" style="border-bottom: solid 1.5pt black">Kelas</th>
                <th width="60" style="border-bottom: solid 1.5pt black">Ruang</th>
                <th width="150" style="border-bottom: solid 1.5pt black">Dosen Pengampu</th>
            </tr>
            <?php $guard = 1; ?>

            <?php foreach($hari as $day): //Foreach Hari ?>

                     <?php $total_row = 0; ?>

                     <?php $dataJadwalKuliah = $this->sirak_akad_model->getJadwalKuliahByIdHari($day->ID,$this->session->userdata('siamunp_user_prodi'),$kontrol->KODE_SEMESTER,$kontrol->KODE_TAHUN,0); ?>

                     <?php if($dataJadwalKuliah && $adaYangBelumDivalidasi==FALSE): ?>
                            <?php $rowspan = TRUE; ?>

                            <?php foreach($dataJadwalKuliah as $jadwal): ?>
                                    <?php $dataKrs = $this->akad_model->getViewKrsAll($this->session->userdata('siamunp_user'),$kontrol->KODE_TAHUN,$kontrol->KODE_SEMESTER); ?>
                                    <?php if($dataKrs): ?>
                                            <?php foreach($dataKrs as $krs): ?>
                                                    <?php if($jadwal->ID_MK_TERSEDIA == $krs->ID_MK_TERSEDIA): ?>
                                                           <?php $total_row++; ?>
                                                    <?php endif ?>
                                            <?php endforeach ?>
                                    <?php endif ?>

                            <?php endforeach ?>

                            <?php $no_duplicate = 0 ?>
                            <?php foreach($dataJadwalKuliah as $jadwal): ?>
                                    <?php $dataKrs = $this->akad_model->getViewKrsAll($this->session->userdata('siamunp_user'),$kontrol->KODE_TAHUN,$kontrol->KODE_SEMESTER); ?>
                                    <?php if($dataKrs): ?>
                                           <?php foreach($dataKrs as $krs): ?>
                                                    <?php if($jadwal->ID_MK_TERSEDIA == $krs->ID_MK_TERSEDIA): ?>
                                                           <tr align="center">
                                                           <?php if($rowspan): ?>
                                                                  <td rowspan="<?php echo $total_row ?>"><?php echo ucwords(strtolower($day->NAMA_HARI)) ?></td>
                                                                  <?php $rowspan = FALSE; ?>
                                                           <?php endif; ?>

                                                           <td><?php echo substr($jadwal->MULAI, 0, 5) ?> - <?php echo substr($jadwal->SELESAI, 0, 5) ?></td>
                                                           <td><?php echo strtoupper($jadwal->KODE_MK) ?></td>
                                                           <td align="left" style="padding-left:10px"><?php echo $jadwal->NAMA_MK ?></td>
                                                           <td><?php echo $jadwal->SKS ?></td>
                                                           <td><?php echo $jadwal->KELAS ?></td>
                                                           <td><?php echo $jadwal->RUANG ?></td>
                                                           <td align="left" style="padding-left:10px"><?php echo $jadwal->NAMA_DOSEN ?><?php echo ($jadwal->GELAR_DOSEN)? ', '.$jadwal->GELAR_DOSEN:'' ?></td>
                                                           </tr>
                                                    <?php endif ?>
                                           <?php endforeach ?>
                                     <?php endif ?>
                                     <?php if($total_row == 0 && $no_duplicate == 0): ?>
                                           <tr align="center">
                                             <td><?php echo ucwords(strtolower($day->NAMA_HARI)) ?></td>
                                             <td align="left" colspan="7">-</td>
                                           </tr>
                                     <?php endif ?>
                            <?php $no_duplicate++ ?>
                            <?php endforeach; ?>
                     <?php elseif($total_row == 0): ?>
                           <tr align="center">
                             <td><?php echo ucwords(strtolower($day->NAMA_HARI)) ?></td>
                             <td align="left" colspan="7">-</td>
                           </tr>
                     <?php endif ?>

            <?php endforeach; ?>

  </table>

<br />

</div>

</div>